<!DOCTYPE html>
<html lang="ar">
<head>
    <title>الاتفاقيات</title>
	<?php
	 define('LAST_CAPITRE_ID',19);
	 define('LAST_ARTICLE_CODE',3);
	?>

	<?php $this->load->helper('url');?>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta charset="utf-8">

<!---------------------for autocomplete--------------->
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-1.11.0.min.js');?>" ></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-ui-1.10.4/js/jquery-ui-1.10.4.min.js');?>" ></script>
	<link href="<?php echo base_url("assets/css/jquery-ui.css")?>" rel="stylesheet" type="text/css" />
	<!------------------------------------------------------>
<!---------------------for form css ----------------------->
	<link href="<?php echo base_url("assets/css/pure.css")?>" rel="stylesheet" type="text/css" />
	
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.tablesorter.min.js');?>" ></script>
		<link href="<?php echo base_url("assets/css/table.css")?>" rel="stylesheet" type="text/css" />
	<link href="<?php echo base_url("assets/css/ch_menu.css")?>" rel="stylesheet" type="text/css" />
	 <link href="<?php echo base_url("assets/css/botton.css")?>" rel="stylesheet" type="text/css" />
	
</head>


<?php include_once('header.php');

		//$r=$les_convention;
		 $this->load->library('session');
        $num_ar=$this->session->userdata('data_charticle'); //access it
        $chcl=$num_ar;
 ?>
 



<?PHP
 $year=$this->session->userdata('annee');
$montant_consomer=0;

?>

<form id="convention_form" class="pure-form pure-form-stacked"  method="POST" action="<?php echo base_url('/etat_financier_ctr/');?>">
    
        <legend>الوضعية المالية لسنة : <?php echo('<strong>'.$year.'</strong>');?></legend>

        <div class="pure-g">
		
			
<?php	
$compt=0;//compteur pour la table des noms de chapitres
for($k=0;$k<sizeof($consommer);$k++){	
        
		if($budget_init_ch)$init=$budget_init_ch[$k]->solde;
		else $init=0;
		if($budget_supl_ch)$supl=$budget_supl_ch[$k]->solde;
		else $supl=0;
		$total=$init+$supl;
		$rest=$total-$consommer[$k];
		echo('		   <div class="pure-u-1 pure-u-md-1-3" style="width: 90%">
		    <label style="font-size: 130%; text-decoration: underline; color: red;"> '.$nom_art[$k]->nom.'</label>
			 </div>
			  <div class="pure-u-1 pure-u-md-1-3 " style="width: 19%">
                <label for="article">الاعتماد المفوض </label>
                <input  class="ltr" id="date" name="'.$k.'" type="text" value="'.$init.'" >
            </div>
			 <div class="pure-u-1 pure-u-md-1-3 " style="width: 19%">
                <label for="article">الاعتماد المعدل </label>
                <input  class="ltr" id="date" name="'.$k.'" type="text" value="'.$supl.'" >
            </div>
			<div class="pure-u-1 pure-u-md-1-3 " style="width: 19%">
                <label for="article">الاعتماد المراجع </label>
                <input  class="ltr" id="date" name="'.$k.'" type="text" value="'.$total.'" >
            </div>
         <div class="pure-u-1 pure-u-md-1-3 " style="width: 19%">
                <label for="article">الالتزامات </label>
                <input  class="ltr" id="date" name="'.$k.'" type="text" value="'. $consommer[$k].'">
            </div>
			<div class="pure-u-1 pure-u-md-1-3 " style="width: 19%">
                <label for="article">رصيد الالتزامات</label>
                <input  class="ltr" id="date" name="'.$k.'" type="text" value="'.$rest.'">
            </div>
			
			
			');
			
			}
?>			
		
		 
			
			 </div>
			     <?php
			
				
  $goupe=$this->session->userdata('user_group'); //access it
if($goupe=="admin"){
echo ('
	 <a href="'.base_url('/etat_financier_ctr/').'" class="pure-button pure-button-primary" >عودة</a>');
}else{
	echo ('
	 <a href="'.base_url('/etat_financier_ctr/').'" class="pure-button pure-button-primary" >عودة</a>');
}
?>
	
		</form>


  <script>
 $(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
); 
 </script>  
  <script>
$(function() {
	var liste_fourniss = <?php echo json_encode($liste_des_fournisseurs); ?>;
	$( "#nom" ).autocomplete({source: liste_fourniss});
	} 
); 
</script> 

</html>